#ifndef SX_IGAME_H
#define SX_IGAME_H

typedef struct tagGameEvent
{
	tagGameEvent()
	{
		nEventType = 0;
		nEventID = 0;
		nParam1 = 0;
		nParam2 = 0;
		nParam3 = 0;
		nParam4 = 0;
	}

	tagGameEvent(int _nEventType, int _nEventID, int _nParam1=0, int _nParam2=0, int _nParam3=0, int _nParam4=0)
	{
		nEventType = _nEventType;
		nEventID = _nEventID;
		nParam1 = _nParam1;
		nParam2 = _nParam2;
		nParam3 = _nParam3;
		nParam4 = _nParam4;
	}
	int nEventType;
	int nEventID;
	int nParam1;
	int nParam2;
	int nParam3;
	int nParam4;
} GameEvent_t;


class IEventListener
{
public:
	virtual int OnEvent(GameEvent_t * pEvent) = 0;
};

class IGamePub
{
public:
	virtual int Init() = 0;
	virtual void Release() = 0;
	virtual int LoadAllModues() = 0;
	virtual IModule* GetModule(int nModuleID) = 0; 
};

class IModule
{
	virtual int Init(IGamePub* pGamePub);
	virtual void Release() = 0;
	virtual int GetModuleID() = 0;

	virtual int SendGlobalEvent(int nEventType, int nEventID, int nParam1=0, int nParam2=0, int nParam3=0, int nParam4=0) = 0;
	virtual int SendEventTo(int nToModuleID, int nEventType, int nEventID, int nParam1=0, int nParam2=0, int nParam3=0, int nParam4=0) = 0;
};

#endif